package ynu.edu.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import ynu.edu.common.service.LogicService;
import ynu.edu.dao.*;
import ynu.edu.entity.*;


@Service
public class UserService extends LogicService<UserDao,User,Long> {

    public UserService(@Autowired UserDao dao) {
        super(dao);
    }

    /**
     *  TODO
     * @param name
     * @param password
     * @return
     */
    public User login(String name, String password){
        Business business=new Business();
        business.setPassword(password);
        return getDAO().getUserByNameAndPassword(name,business.getPassword());
    }
}
